Color Limits
Transfer mode operations allow you to specify limits on the acceptable input values for the source or destination color, and on the acceptable output values for the result color. For example, in converting CMYK color to RGB, you may wish to limit the intensities to values that can be displayed without oversaturating the phosphors on a monitor's screen. Or, to create a special effect, you may want to draw only the extreme light and dark portions of an image, leaving out its midrange entirely.Each color component in the
component
field of the transfer mode structure can have a maximum and a minimum permitted value. The permissible ranges can be interpreted as shown in Figure 5-11. In the figure, the large cube represents all of RGB space; the small cube represents one possible example of the limits that could be imposed on allowable values for all three components.Figure 5-11 Maximum and minimum color-component values in RGB space
In the case of source and destination colors, color values outside the range of acceptable values (that is, outside the small cube in Figure 5-11) are ignored; if any single component value is outside of its acceptable range, no drawing occurs at all for that color. In the case of the calculated colors that result from a given transfer mode operation, color values outside of the acceptable range are pinned to, or moved so that they don't exceed, the nearest acceptable value (the closest edge of the small cube). See Figure 5-12.
Figure 5-12 How minimum and maximum color limits affect drawing
For a given component, the maximum value for a color limit can be either greater or smaller than the minimum. If the maximum is less than the minimum, only the extreme color values (that is, values outside of the small cube area in Figure 5-11) are allowed. See Figure 5-13.
Figure 5-13 How reversed minimum and maximum color limits affect drawing
Each of the components in a color space can have its limits set entirely independently
of the others. Figure 5-14 shows the effects of reversing, in turn, the maximum and minimum values for each of the three axes in RGB space.Figure 5-14 The effects of reversing maximum and minimum in a color space
Where the words Min and Max are bold in Figure 5-14, the minimum is greater than the maximum. Refer to Figure 5-11 on page 5-28 for the positions of the color axes on the RGB cube in this figure:
- In drawing (A), all minimum limits are less than their respective maximums; the allowable color ranges form a small cube, just as in Figure 5-11.
- In drawing (B), the maximum on the red axis is less than the minimum; only red color values outside of the range of the small cube are permitted, whereas blue and green must still be within the limits of the small cube. The acceptable color values form two rectangular solids within RGB space.
- In drawing (C), the maximum and minimum on the green axis are also reversed; the acceptable color values form a more complicated set of solids.
- In drawing (D), all maximum and minimum color limits are reversed. In that case, only color values at the outer corners of the color space (all components outside of the range of the small cube) are acceptable.
Source Color Limits
ThesourceMinimum
andsourceMaximum
fields in a color component'sgxTransferComponent
structure define the allowable range of values for source color in that component. Color values outside of the range cause no drawing to occur. IfsourceMaximum
is less thansourceMinimum
, the range allowed consists of values less thansourceMaximum
or greater thansourceMinimum
. Figure 5-15 shows the effect ofsourceMinimum
andsourceMaximum
on drawing using blend mode.Figure 5-15 The effect of source color limits on drawing
Note in Figure 5-15 that, when
sourceMinimum
is less thansourceMaximum
, only the cloud in the source image is within the source limits, so only the cloud is blended with the destination image to create the result. Conversely, whensourceMaximum
is less thansourceMinimum
, the cloud in the source image is outside the source limits, so it is the only part of the source that is not blended with the destination image when creating the result.Destination Color Limits
ThedeviceMinimum
anddeviceMaximum
fields in a color component'sgxTransferComponent
structure define the allowable range of values for destination color in that component. Destination color values outside of the range cause no drawing to occur for that color. IfdeviceMaximum
is less thandeviceMinimum
, the range allowed consists of values less thandeviceMaximum
or greater thandeviceMinimum
. Figure 5-16 shows the effect ofdeviceMinimum
anddeviceMaximum
on drawing using blend mode.Figure 5-16 The effect of destination color limits on drawing
Note in Figure 5-16 that, when
deviceMinimum
is less thandeviceMaximum
, only the letter "A" in the destination image is within the destination limits, so the source is blended with the destination image only within the limits of the "A" to create the result. Conversely, whendeviceMaximum
is less thandeviceMinimum
, the "A" is outside the destination limits, so it is the only part of the destination not blended with the source to create the result.Result Color Limits
TheclampMinimum
andclampMaximum
fields in a color component'sgxTransferComponent
structure define the allowable range of values for the result color in that component. Color values outside of the range are pinned to the nearest clamp limit. IfclampMaximum
is less thanclampMinimum
, the range allowed consists of values less thanclampMaximum
or greater thanclampMinimum
. Figure 5-17 shows the effect ofclampMinimum
andclampMaximum
on drawing using blend mode.Figure 5-17 The effect of result color limits on drawing
Note in Figure 5-17 that, when
clampMinimum
is less thanclampMaximum
, extreme color values cannot occur in the result. The portions of the "A" outside of the cloud are darker than they would normally be with blend mode, and the portions of the cloud outside of the letter are lighter than they would normally be. Conversely, whenclampMaximum
is less thanclampMinimum
, midrange values are not possible in the result. The background in the result is lighter than it would normally be with blend mode, and the portions of the cloud outside of the "A" are darker than they would normally be.
- Note
- Pinning restricts the value of the computation, not necessarily the value allowed for the actual pixel. The pixel value is the closest found to the computation, which may be outside of the range of
clampMinimum
andclampMaximum
.![]()